<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .sty-1{
            font-size: 20px;
            color: red;
        }

        .sty-2{
            font-size: 30px;
            color: blue;
        }
    </style>
</head>
<body>
    <input type="text" name="set_size" id="input-1" value="麦麦真好看">
    <a href="https:www.baidu.com" id="link-1" class="sty-1">Baidu</a>
</body>
<script>
    window.onload = function(){
        var my_input = document.getElementById('input-1');
        var my_link = document.getElementById('link-1');

        // 读取属性
        var input_value = my_input.value;
        var input_type = my_input.type;
        var input_name = my_input.name;

        var link_url = my_link.href;
        console.log(input_value,input_type,input_name,link_url);

        // 操作属性
        my_input.className = 'sty-2';
        my_link.style.background = 'black';
    }
</script>
</html>